import { createApp } from 'vue'
import './assets/css/style.less'
import App from './App.vue'
import router from './router'
import directive from './directive'
import ArcoVue from '@arco-design/web-vue'
import '@arco-design/web-vue/dist/arco.css'
import ArcoVueIcon from '@arco-design/web-vue/es/icon'
import '@/assets/js/icon'
import pinia from './store';
import i18n from './locales'
import { useRules } from './hooks/rules'
import { useUuid } from './hooks/uuid'

const app = createApp(App)
app.config.globalProperties.$rules = useRules // 表单校验
app.config.globalProperties.$uuid = useUuid // 数学计算
app.use(i18n)
app.use(ArcoVue)
app.use(ArcoVueIcon)
app.use(router)
app.use(pinia); // 引入pinia仓库
directive(app); // 引入指令
app.mount('#app')

declare module '@vue/runtime-core' {
    interface ComponentCustomProperties {
        $rules: typeof useRules;
        $uuid: typeof useUuid;

    }
}
